<?php
/**
 * ClassName: UserModel
 * Description: 用户model类
 * @Author 周昌
 * @Create 2023/11/15 13:59
 */

namespace model;


class MemberModel extends BaseModel
{
    protected $name='member';

    //时间获取器
    public function getAddTimeAttr($value){
        if(!empty($value)&& is_integer($value)){
            return date('Y-m-d H:i:s', $value);
        }else{
            return $value;
        }

    }

    //member--archives 一对一关联

    /**
     * #User: Administrator
     * #Time: 2023/11/30 13:11
     * #Author:周昌
     * #Description:
     * 一对一关联
     *
     */
    public function archives(){
        return $this->hasMany('ArchivesModel','member_id','id');
    }
    //member 对member_info 一堆多关联
    public function info(){
        return $this->hasMany('MemberInfoModel','member_id','id');
    }

}